const express = require('express');
const router = express.Router();
const surveyController = require('../controllers/surveyController');

// 获取问卷列表
router.get('/', surveyController.getSurveys);

// 获取仪表盘数据
router.get('/dashboard', surveyController.getDashboardData);

// 创建问卷
router.post('/', surveyController.createSurvey);

// 获取问卷详情
router.get('/:id', surveyController.getSurveyDetail);
// router.get('/detail/:id', surveyController.getSurveyDetail); // 保留旧路径以兼容
// 删除问卷
router.delete('/:id', surveyController.deleteSurvey);
// 更新问卷（保存/发布）
router.put('/:id', surveyController.updateSurvey);

module.exports = router;